#!/bin/zsh
#PBS -N $i
#PBS -l nodes=1:ppn=48
#PBS -q batch
#PBS -p 1023 
#PBS -j oe
#PBS -e job.error 
#PBS -o job.log
source ~/.zshrc

echo "--- This job is:$PBS_JOBNAME(${PBS_JOBID%.*})@$PBS_QUEUE"  
echo "--- Current working directory is:${PBS_O_WORKDIR}"
nprocs=$(cat ${PBS_NODEFILE} | wc -l) 
nprocss=$(($nprocs*2))
echo "--- Running on ${nprocs} processes (cores) on the following nodes:" && cat $PBS_NODEFILE | uniq
echo "--- Starting job at:`date`"

cd $PBS_O_WORKDIR

./bin/generate_events -f >log

echo "--- Job finished at:`date`"
qstat | grep $PBS_JOBNAME | awk '{print "--- Total CPU hours:"$4}''""}'""

